<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/9
  Time: 9:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
<head>
  <base href="<%=basePath%>">
  <link href="css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print"/>
  <link href="css/print.css" rel="stylesheet" type="text/css" media="print"/>
  <script src="js/jquery-1.10.1.min.js"></script>
  <script src="js/side.js" type="text/javascript"></script>
  <script src="js/jquery-3.6.0.js"></script>
  <script>
    function Update_Enterprise(e) {
      var formObject = {};
      var formArray = $("#form2").serializeArray();
      $.each(formArray, function (i, item) {
        formObject[item.name] = item.value;
      });
      $.ajax({
        url: 'admin_info/Update_Enterprise',
        headers: {
          'Content-Type': 'application/json;charset=utf-8',
        },
        type: 'POST',
        data: JSON.stringify(formObject),
        dataType: "json",
        success: function (data) {
          if (data.code == '0100') {
            console.log(data.message);
            alert("修改失败");
          } else if (data.code == '0102') {
            alert("没有修改任何数据");
            window.location.href = 'admin_info/View_Enterprise';
          } else if (data.code == '0101') {
            console.log(data.message);
            alert("修改成功");
            window.location.href = 'admin_info/View_Enterprise';
          }
        }
      })
    }
  </script>
</head>
<body>
<%
  int comId = Integer.parseInt(request.getParameter("comId"));
  String comName = request.getParameter("comName");
  String comLocal = request.getParameter("comLocal");
  String recruitmentRequirements = request.getParameter("recruitmentRequirements");
  String recruitmentPositions = request.getParameter("recruitmentPositions");
  String salaryRange = request.getParameter("salaryRange");
  String vocationalInfo = request.getParameter("vocationalInfo");
  String enStatus = request.getParameter("enStatus");
  String comAccount = request.getParameter("comAccount");
%>

<form id="form2">
  <div id="Popup">
    <div id="SubPopup">
      <div class="form_boxC">
        <p>"<span class="f_cB">*</span>"号为不可修改项目</p>
        <table cellpadding="0" cellspacing="0">
          <tr>
            <th width="100">企业编号 <span class="f_cB"></span></th>
            <td>
              <div class="txtbox floatL" style="width:100px;">
                <input name="comId" type="text" size="5" value=<%=comId%>>
              </div>
            </td>
          </tr>
          <tr>
            <th>企业名称 <span class="f_cB"></span></th>
            <td>
              <div class="txtbox floatL" style="width:230px;">
                <input name="comName" type="text" size="20" value=<%=comName%>>
              </div>
            </td>
          </tr>
          <tr>
            <th>企业地点 <span class="f_cB"></span></th>
            <td>
              <div class="txtbox floatL" style="width:230px;">
                <input name="comLocal" type="text" size="20" value=<%=comLocal%>>
              </div>
            </td>
          </tr>
          <tr>
            <th>招聘要求 <span class="f_cB"></span></th>
            <td>
              <div class="txtbox floatL" style="width:230px;">
                <input name="recruitmentRequirements" type="text" size="20"
                       value=<%=recruitmentRequirements%>>
              </div>
            </td>
          </tr>
          <tr>
            <th>招聘地点 <span class="f_cB"></span></th>
            <td>
              <div class="txtbox floatL" style="width:200px;">
                <input name="recruitmentPositions" type="text" size="10"
                       value=<%=recruitmentPositions%>>
              </div>
            </td>
          </tr>
          <tr>
            <th>薪资范围 <span class="f_cB"></span></th>
            <td>
              <div class="txtbox floatL" style="width:100px;">
                <input name="salaryRange" type="text" size="6" value=<%=salaryRange%>>
              </div>
            </td>
          </tr>
          <tr>
            <th>公司账号 <span class="f_cB">*</span></th>
            <td>
              <div class="txtbox floatL" style="width:140px;">
                <input name="comAccount" type="text" size="10"
                       value=<%=comAccount%> readonly>
              </div>
            </td>
          </tr>
          </tr>
        </table>
      </div>
      <div id="BtmBtn">
        <div class="btn_boxB floatR mag_l20">
          <button style="cursor: pointer;background-color: #36c4aa;color: white;padding: 12px 20px;display: inline-block;font-size: 15px;" type="submit" onclick="Update_Enterprise()">确定</button>
        </div>
        <div class="btn_box floatR">
          <button style="cursor: pointer;background-color: #36c4aa;color: white;padding: 12px 20px;display: inline-block;font-size: 15px;"><a style="color: white; text-decoration:none;" href="admin_info/View_Enterprise">返回</a></button>
        </div>
      </div>
    </div>
  </div>
</form>

</body>
</html>

